﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ComponentModel;
using System.ServiceModel.Web;

namespace Chinaer.WCF.Contracts
{
    public partial interface IChinaer
    {
        [OperationContract]
        [Description("根据城市获取地区列表")]
        [WebInvoke(
             ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
             BodyStyle = WebMessageBodyStyle.Bare,
             UriTemplate = "GetAreasByCityID/{cityID}",
             Method = "GET"
            )]
        List<DTO.AreaDTO> GetAreasByCityID(string cityID);

        [OperationContract]
        [Description("保存地区")]
        [WebInvoke(
             ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
             BodyStyle = WebMessageBodyStyle.Bare,
             UriTemplate = "SaveArea",
             Method = "POST"
            )]
        Model.Common.JsonResult AddArea(DTO.AreaDTO areaDTO);

        [OperationContract]
        [Description("根据城市获取地区列表")]
        [WebInvoke(
             ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
             BodyStyle = WebMessageBodyStyle.Bare,
             UriTemplate = "UpdateArea",
             Method = "POST"
            )]
        Model.Common.JsonResult UpdateArea(DTO.AreaDTO areaDTO);

        [OperationContract]
        [Description("删除地区")]
        [WebInvoke(
             ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
             BodyStyle = WebMessageBodyStyle.Bare,
             UriTemplate = "DeleteArea",
             Method = "POST"
            )]
        Model.Common.JsonResult DeleteArea(DTO.AreaDTO areaDTO);

        [OperationContract]
        [Description("根据编号删除地区")]
        [WebInvoke(
             ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
             BodyStyle = WebMessageBodyStyle.Bare,
             UriTemplate = "DeleteAreaByID/{areaID}",
             Method = "GET"
            )]
        Model.Common.JsonResult DeleteAreaByID(string areaID);
    }
}
